﻿namespace = heavenly

# Missionaries from treaty port build hospitals/schools
heavenly.1 = {
	type = country_event
	placement = scope:missionary_state

	title = heavenly.1.t
	desc = heavenly.1.d
	flavor = heavenly.1.f

	event_image = {
		video = "gfx/event_pictures/southamerica_christianity.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/southamerica/christianity"

	icon = "gfx/interface/icons/event_icons/event_scales.dds"

	duration = 3

	trigger = {
		NOT = {
			root.religion = { 
				has_discrimination_trait = christian
			}
		}
		NOT = {
			has_modifier = opium_wars_addiction_modifier
		}
		any_scope_state = {
			is_incorporated = yes
			any_scope_pop = {
				NOT = {
						OR = {
							religion = rel:protestant
							religion = rel:reformed
							religion = rel:anglican
						}
				}
			}
			average_sol < 10
			any_neighbouring_state = {
				is_treaty_port = yes
				owner = {
						religion = { #The Taiping Heavenly Kingdom was Protestant (therabouts), but the missionaries which spread Christian dogma to it were from Macao.
							has_discrimination_trait = christian
						}
					}
			}
		}
	}
	immediate = {
		random_scope_state = {
			limit = {
				is_incorporated = yes
				any_scope_pop = {
					NOT = {
						OR = {
							religion = rel:protestant
							religion = rel:reformed
							religion = rel:anglican
						}
					}
				}
				any_neighbouring_state = {
					is_treaty_port = yes
					owner = {
						religion = {
							has_discrimination_trait = christian
						}
					}
				}
			}
			save_scope_as = missionary_state
			random_neighbouring_state = {
				limit = {
					is_treaty_port = yes
					owner = {
						religion = {
							has_discrimination_trait = christian
						}
					}
				}
				save_scope_as = treaty_port_scope
				owner = {
					save_scope_as = treaty_port_owner
				}
			}
		}
	}

	option = {
		name = heavenly.1.a
		default_option = yes
		scope:missionary_state = {
			add_modifier = {
				name = missionary_schools_hospitals
				months = normal_modifier_time
			}
		if = {
			limit = {
				exists = c:CHI
				ROOT = c:CHI
			}
			convert_population = {
				target = rel:god_society
				value = 0.05
			}
		}
		else = {
		if = {
			limit = {
				scope:treaty_port_owner = {
					religion = rel:anglican
				} 
			}
			convert_population = {
				target = rel:anglican
				value = 0.05
			}
		}
		if = {
			limit = {
				scope:treaty_port_owner = {
					religion = rel:reformed
				} 
			}
			convert_population = {
				target = rel:reformed
				value = 0.05
			}
		}
		if = {
			limit = {
				scope:treaty_port_owner = {
					religion = rel:protestant
				} 
			}
			convert_population = {
				target = rel:protestant
				value = 0.05
			}
		}
		}


		}
	}
	option = {
		name = heavenly.1.b
		change_relations = {
			country = scope:treaty_port_owner
			value = -10
		}
		scope:missionary_state = {
		if = {
			limit = {
				exists = c:CHI
				ROOT = c:CHI
			}
			convert_population = {
				target = rel:god_society
				value = 0.01
			}
		}
		else = {
		if = {
			limit = {
				scope:treaty_port_owner = {
					religion = rel:anglican
				} 
			}
			convert_population = {
				target = rel:anglican
				value = 0.01
			}
		}
		if = {
			limit = {
				scope:treaty_port_owner = {
					religion = rel:reformed
				} 
			}
			convert_population = {
				target = rel:reformed
				value = 0.01
			}
		}
		if = {
			limit = {
				scope:treaty_port_owner = {
					religion = rel:protestant
				} 
			}
			convert_population = {
				target = rel:protestant
				value = 0.01
			}
		}
		}

		}
	}
}

# The God Worshipping Society
heavenly.2 = {
	type = country_event
	placement = scope:cult_state

	title = heavenly.2.t
	desc = heavenly.2.d
	flavor = heavenly.2.f

	event_image = {
		video = "gfx/event_pictures/asia_union_leader.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/asia/union_leader"

	icon = "gfx/interface/icons/event_icons/event_newspaper.dds"

	duration = 3	

	cooldown = { months = very_long_modifier_time }

	trigger = {
	}

	immediate = {
		random_scope_state = {
			limit = {
				has_modifier = god_worshippers
			}
			save_scope_as = cult_state
			set_variable = {
				name = cult_center
			}
		}
	}
	option = {
		name = heavenly.2.a
		scope:cult_state = {
			# Already added when the Journal Entry activated, but we're going to remove it and add it again to make it visible to the player
			hidden_effect = {
				remove_modifier = god_worshippers
			}
			add_modifier = {
				name = god_worshippers
				months = normal_modifier_time
			}
			convert_population = {
				target = rel:god_society value = 0.1
			}
		}
	}
}

# Cult Grows
# Repeatable
heavenly.3 = {
	type = country_event
	placement = scope:cult_growth_state

	title = heavenly.3.t
	desc = heavenly.3.d
	flavor = heavenly.3.f

	event_image = {
		video = "gfx/event_pictures/asia_union_leader.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/asia/union_leader"

	icon = "gfx/interface/icons/event_icons/event_newspaper.dds"

	duration = 3

	cooldown = { months = 6 }

	trigger = {
		any_scope_state = {
			state_region = { is_homeland = cu:han NOT = { is_homeland = cu:manchu } }
			has_variable = cult_center
			any_scope_pop = {
				has_pop_religion = god_society
			}
			any_neighbouring_state = {
				owner = ROOT
				NOT = {
					has_variable = cult_center
				}
				NOT = { is_capital = yes }
				state_region = { 
					OR = {
						is_homeland = cu:han 
						is_homeland = cu:hakka 
					}
				}
			}
		}
	}
	immediate = {
		random_scope_state = {
			limit = {
				has_variable = cult_center
				any_scope_pop = {
					has_pop_religion = god_society
				}
				any_neighbouring_state = {
					owner = ROOT
					NOT = {
						has_variable = cult_center
					}
					state_region = {
						OR = {
							is_homeland = cu:han 
							is_homeland = cu:hakka
						}
					}
					NOT = { is_capital = yes }
				}
			}
			save_scope_as = cult_center
			random_neighbouring_state = {
				limit = {
					owner = ROOT
					NOT = {
						has_variable = cult_center
					}
					state_region = { 
						OR = {
							is_homeland = cu:han 
							is_homeland = cu:hakka 
						}
					}
					NOT = { is_capital = yes }
				}
				save_scope_as = cult_growth_state
				set_variable = {
					name = cult_center
				}
			}
		}
	}
	option = {
		name = heavenly.3.a
		scope:cult_growth_state = {
			add_modifier = {
				name = god_worshippers
				months = normal_modifier_time
			}
			convert_population = {
				target = rel:god_society value = 0.1
			}
		}
	}
}

# Heavenly Kingdom spawn
# Heavenly Kingdom spawn
heavenly.4 = {
	type = country_event
	placement = ROOT

	title = heavenly.4.t
	desc = heavenly.4.d
	flavor = heavenly.4.f

	event_image = {
		video = "gfx/event_pictures/asia_union_leader.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/asia/union_leader"

	icon = "gfx/interface/icons/event_icons/event_fire.dds"

	duration = 3

	trigger = {

	}
	immediate = {
		every_state = {
			limit = {
				has_modifier = god_worshippers
			}
			remove_modifier = god_worshippers
		}
		c:CHI = {
			every_scope_state = {
				limit = {
					is_incorporated = yes
				}
				set_variable = saved_incorporated_state
			}
		}		
		random_scope_state = {
			limit = {
    			state_region = { is_homeland = cu:han NOT = { is_homeland = cu:manchu } }
				has_variable = cult_center
				any_scope_pop = {
					has_pop_religion = god_society
				}
				radical_fraction = { value >= 0.15 }
			}
			save_scope_as = heavenly_kingdom_spawn
		}
		create_country = {
			tag = TPG
			origin = this
			state = scope:heavenly_kingdom_spawn
			on_created = {
				ig:ig_devout = {
					set_interest_group_name = ig_taiping_god_worshippers
					remove_ideology = ideology_moralist
					add_ideology = ideology_heavenly_kingdom_theocratic
					add_modifier = {
						name = taiping_god_worshippers
						months = very_long_modifier_time
						is_decaying = yes
					}
				}
				if = {
					limit = {
						NOT = {
							has_ruling_interest_group = ig_devout
						}
					}
					ig:ig_devout = {
						leader = {
							set_ideology = ideology_theocrat
						}
						add_ruling_interest_group = yes
					}
				}
				every_interest_group = {
					limit = {
						OR = {
							is_interest_group_type = ig_intelligentsia
							is_interest_group_type = ig_armed_forces
							is_interest_group_type = ig_rural_folk
							is_interest_group_type = ig_devout
						}
					}
					add_modifier = {
						name = taiping_taiping_revolution
						months = long_modifier_time
					}
				}
				add_modifier = {
					name = taiping_land_socialization
					months = long_modifier_time
					is_decaying = yes
				}
				if = {
					limit = {
						NOT = {
							has_law = law_type:law_theocracy
						}
					}
					activate_law = law_type:law_theocracy
				}
				if = {
					limit = {
						NOT = {
							has_law = law_type:law_state_religion
						}
					}
					activate_law = law_type:law_state_religion
				}
				if = {
					limit = {
						NOT = {
							has_law = law_type:law_peasant_levies
						}
					}
					activate_law = law_type:law_peasant_levies
				}
				if = {
					limit = {
						NOT = {
							has_law = law_type:law_national_supremacy
						}
					}
					activate_law = law_type:law_national_supremacy
				}
				if = {
					limit = {
						NOT = {
							has_law = law_type:law_serfdom_banned
						}
					}
					activate_law = law_type:law_serfdom_banned
				}
				add_modifier = {
					name = taiping_army_modifier
					months = normal_modifier_time
				}
			}
		}
		c:TPG = { 
			save_scope_as = heavenly_kingdom_scope
			set_variable = { name = gold_transfer value = c:CHI.gold_reserves } #This shouldn't be in the immediate, but it will throw a million errors if you put it somewhere else. DO NOT TOUCH.
			change_variable = { name = gold_transfer divide = 3 }
			set_variable = { name = gold_transfer_nil value = var:gold_transfer }
			change_variable = { name = gold_transfer_nil divide = -1 }

			trigger_event = { id = heavenly.9 }
		}
		if = {
			limit = { has_journal_entry = je_warlord_china }
			post_notification = warlord_china_explosion_point_add
			change_variable = {
				name = china_warlord_explosion
				add = 1
			}
		}
		add_modifier = {
			name = taiping_taiping_rebellion
			months = long_modifier_time
		}
		c:TPG = {		
			add_modifier = {
				name = taiping_taiping_rebellion
				months = long_modifier_time
			}
		}
	}

	option = {
		name = heavenly.4.a
		default_option = yes
		ai_chance = { base = 1 }
		add_journal_entry = {
			type = je_taiping
		}
		c:TPG = {
			add_journal_entry = {
				type = je_taiping_revolution
			}
		}
		assign_taiping_states = yes
		scope:heavenly_kingdom_scope = {		
			create_diplomatic_play = {
				name = taiping_rebellion
				target_country = c:CHI
				type = dp_taiping_rebellion
			}
			hidden_effect = { #Why? Because the Taiping Rebellion play grants an insane amount of infamy.
				change_infamy = -150
			}
		}
		hidden_effect = {
			c:TPG = {
				create_taiping_characters = yes	
				c:CHI = {
					add_treasury = prev.var:gold_transfer_nil
				}
				add_treasury = var:gold_transfer	
			}
			random_diplomatic_play = {
				limit = {
					c:TPG = {
						is_diplomatic_play_initiator = yes
					}
					c:CHI = {
						is_diplomatic_play_target = yes
					}
				}
				add_diplomatic_play_war_support = { target = c:TPG value = 100 }
			}
			every_state = {
				limit = {
					owner = c:CHI
					OR = {	
						is_split_state = no
						state_region = {
							any_state = {
								is_treaty_port = yes
							}
						}
					}
				}
				this.state_region = {
					add_claim = c:TPG
				}
			}
		}	
	}
	option = {
		name = heavenly.4.b
		ai_chance = { base = 0 }
		add_journal_entry = {
			type = je_taiping
		}
		c:TPG = {
			add_journal_entry = {
				type = je_taiping_revolution
			}
		}
		assign_taiping_states = yes
		scope:heavenly_kingdom_scope = {		
			create_diplomatic_play = {
				name = taiping_rebellion
				target_country = c:CHI
				type = dp_taiping_rebellion
			}
			hidden_effect = {
				change_infamy = -150
			}
		}
		hidden_effect = {
			c:TPG = {
				create_taiping_characters = yes	
				c:CHI = {
					add_treasury = prev.var:gold_transfer_nil
				}
				add_treasury = var:gold_transfer	
			}
			random_diplomatic_play = {
				limit = {
					c:TPG = {
						is_diplomatic_play_initiator = yes
					}
					c:CHI = {
						is_diplomatic_play_target = yes
					}
				}
				add_diplomatic_play_war_support = { target = c:TPG value = 100 }
			}
			every_state = {
				limit = {
					owner = c:CHI
					OR = {	
						is_split_state = no
						state_region = {
							any_state = {
								is_treaty_port = yes
							}
						}
					}
				}
				this.state_region = {
					add_claim = c:TPG
				}
			}
		}
		play_as = scope:heavenly_kingdom_scope
	}
}

# Aftermath event
heavenly.5 = {
	type = country_event
	placement = ROOT

	title = heavenly.5.t
	desc = heavenly.5.d
	flavor = heavenly.5.f

	event_image = {
		video = "gfx/event_pictures/asia_union_leader.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/asia/union_leader"

	icon = "gfx/interface/icons/event_icons/event_newspaper.dds"

	duration = 3

	trigger = {
		# triggered by journal entry
	}

	immediate = {
		every_scope_state = {
			limit = {
				owner = ROOT
				has_variable = saved_incorporated_state
			}
			set_state_owner = c:CHI #Just in case.
			set_state_type = incorporated
		}
		root.religion = {
			save_scope_as = state_religion_scope
		}
		root = {
			save_scope_as = china_scope
		}
	}

	option = { # mass re-conversions
		name = heavenly.5.a
		default_option = yes
		custom_tooltip = {
			text = mass_reconversion_tt
			every_scope_state = {
				limit = {
					any_scope_pop = {
						religion = rel:god_society
					}
				}
				add_religion_standard_of_living_modifier = {
					religion = rel:god_society
					multiplier = -3
				}
				convert_population = {
					target = rel:mahayana value = 0.1
				}
			}
		}
		ordered_country = {
			limit = {
				country_rank >= rank_value:great_power
				religion = {
					has_discrimination_trait = christian
				}
			}
			order_by = country_rank
			save_scope_as = christian_gp
		}
		create_incident = {
			country = scope:christian_gp
			value = 25
		}
		every_country = {
			limit = {
				country_rank >= rank_value:great_power
				religion = {
					has_discrimination_trait = christian
				}
			}
			change_relations = {
				country = root
				value = -25
			}
		}
	}
	option = { # mercy and pardons
		name = heavenly.5.b
		add_loyalists = {
			value = 0.2
			religion = rel:god_society
		}
	}
}


# Aftermath event - TPG
heavenly.6 = {
	type = country_event
	placement = ROOT

	title = heavenly.6.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = c:CHI
				}
				desc = heavenly.6.d1
			}
			triggered_desc = {
				trigger = {
					always = yes
				}
				desc = heavenly.6.d
			}
		}
	}
	flavor = heavenly.6.f

	event_image = {
		video = "gfx/event_pictures/asia_politician_parliament_motion.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/asia/politician_parliament_motion"

	icon = "gfx/interface/icons/event_icons/event_map.dds"

	duration = 3

	trigger = {
		# triggered by journal entry
	}

	immediate = {
		if = {
			limit = {
				exists = c:CHI
			}
			c:CHI = {
				save_scope_as = china_scope
			}
		}
		if = {
			limit = {
				ig:ig_intelligentsia = {
					leader = {
						OR = {
							has_ideology = ideology_reformer
							has_ideology = ideology_market_liberal
						}
					}
				}
			}
			ig:ig_intelligentsia = {
				leader = {
					save_scope_as = hong_rengan_scope
				}
			}
		}
		cu:manchu = {
			save_scope_as = manchu_culture
		}
	}

	option = {
		name = heavenly.6.a
		default_option = yes
		add_modifier = {
			name = modifier_conversion_of_china
			months = long_modifier_time
		}
	}
	option = {
		name = heavenly.6.b
		trigger = {
			NOT = {
				ig:ig_intelligentsia = {
					leader = {
						OR = {
							has_ideology = ideology_reformer
							has_ideology = ideology_market_liberal
						}
					}
				}
			}
		}
		ig:ig_intelligentsia = {
			add_modifier = {
				name = modifier_accepted_new_treatise
				months = normal_modifier_time
			}
		}
		add_modifier = {
			name = modifier_new_treatise_on_administration
			months = long_modifier_time
		}
	}
	option = {
		name = heavenly.6.b1
		trigger = {
			ig:ig_intelligentsia = {
				leader = {
					OR = {
						has_ideology = ideology_reformer
						has_ideology = ideology_market_liberal
					}
				}
			}
		}
		ig:ig_intelligentsia = {
			add_modifier = {
				name = modifier_accepted_new_treatise
				months = normal_modifier_time
			}
		}
		add_modifier = {
			name = modifier_new_treatise_on_administration
			months = long_modifier_time
		}
	}
	option = {
		name = heavenly.6.c
		trigger = {
			exists = c:CHI
		}
		ig:ig_armed_forces = {
			leader = {
				set_ideology = ideology_jingoist
			}
			add_modifier = {
				name = hawkish_neighbor_relations
				months = normal_modifier_time
			}
		}
		add_modifier = {
			name = modifier_second_crusade_against_manchu
			months = long_modifier_time
		}
	}
	option = {
		name = heavenly.6.e
		every_country = {
			limit = {
				country_rank >= rank_value:great_power
				religion = {
					has_discrimination_trait = christian
				}
			}
			change_relations = {
				country = c:TPG
				value = 10
			}
		}
		add_modifier = {
			name = modifier_relations_with_west
			months = long_modifier_time
		}
	}
}

# Aftermath event - TPG
heavenly.9 = {
	type = country_event
	placement = ROOT

	title = heavenly.9.t
	desc = heavenly.9.d
	flavor = heavenly.9.f

	event_image = {
		video = "gfx/event_pictures/asia_union_leader.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/asia/union_leader"

	icon = "gfx/interface/icons/event_icons/event_newspaper.dds"

	duration = 3

	trigger = {
		# triggered by journal entry
	}
immediate = {

				create_character = {
					first_name = "Feng"
					last_name = "Yunshan"
					is_general = yes
					culture = cu:hakka
					birth_date = 1815.1.1
					religion = rel:god_society
					interest_group = ig_devout 
					traits = {
							pious
							surveyor
					}
				}

				create_character = {
					first_name = "Yang"
					last_name = "Xiuqing"
					is_general = yes
					culture = cu:yue
					birth_date = 1821.09.23
					religion = rel:god_society
					interest_group = ig_armed_forces 
					traits = {
							ambitious
							basic_offensive_planner
							tactful

					}
				}

				create_character = {
					first_name = "Xiao"
					last_name = "Chaogui"
					is_general = yes
					culture = cu:yue
					birth_date = 1821.09.23
					religion = rel:god_society
					interest_group = ig_devout 
					traits = {
							pious
							charismatic							
					}
				}

				create_character = {
					first_name = "Wei"
					last_name = "Chaogui"
					is_general = yes
					culture = cu:yue
					birth_date = 1823.1.1
					religion = rel:god_society
					interest_group = ig_armed_forces  
					traits = {
							meticulous
							stalwart_defender							
					}
				}

				create_character = {
					first_name = "Shi"
					last_name = "Dakai"
					is_general = yes
					culture = cu:yue
					religion = rel:god_society
					birth_date = 1831.04.1
					interest_group = ig_devout
					traits = {
							direct
							brave	
							persistent						

						}
				}

			}
	option = { 
		name = heavenly.9.a
		default_option = yes

			hidden_effect = {
				if = {
					limit = {
						exists = c:RUS
						c:RUS = {
							is_subject = no
						}

						OR = {
							c:CHI = {
								owns_entire_state_region = STATE_OUTER_MANCHURIA
							}
							AND = {
								exists = c:MCH
								c:MCH = {
									owns_entire_state_region = STATE_OUTER_MANCHURIA
								}

							}
						}
					}
					c:RUS = {
						trigger_event = {
							id = heavenly.7
						}
					}
				}
			}


	}
}

# Treaty of Aigun
heavenly.7 = {
	type = country_event
	placement = scope:aigun_state

	title = heavenly.7.t
	desc = heavenly.7.d
	flavor = heavenly.7.f

	event_image = {
		video = "gfx/event_pictures/asia_union_leader.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/asia/union_leader"

	icon = "gfx/interface/icons/event_icons/event_fire.dds"

	minor_left_icon = c:CHI
	minor_right_icon = c:RUS

	duration = 3

	trigger = {

	}
	immediate = {

		if = {
			limit = {
				c:CHI = {
					owns_entire_state_region = STATE_OUTER_MANCHURIA
				}
			}
			c:CHI = {
				random_state = {
					limit = {
						state_region = s:STATE_OUTER_MANCHURIA
					}
					save_scope_as = aigun_state
				}
			}
		}
		else = {
			c:MCH = {
				random_state = {
					limit = {
						state_region = s:STATE_OUTER_MANCHURIA
					}
					save_scope_as = aigun_state
				}
			}
		}

		c:CHI = {
			save_scope_as = chi_scope
		}

		c:TPG = {
			save_scope_as = tpg_scope
		}
	}

	option = {
		name = heavenly.7.a
		custom_tooltip = heavenly.7.a.tt
		default_option = yes
		ai_chance = { base = 75 }

		c:CHI = {
			trigger_event = {
				id = heavenly.8
			}
		}
		
	}
	option = {
		name = heavenly.7.b
		ai_chance = { base = 25 }
	}
}

# Treaty of Aigun Qing
heavenly.8 = {
	type = country_event
	placement = scope:aigun_state

	title = heavenly.8.t
	desc = heavenly.8.d
	flavor = heavenly.8.f

	event_image = {
		video = "gfx/event_pictures/europenorthamerica_before_the_battle.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/europenorthamerica/before_the_battle"

	icon = "gfx/interface/icons/event_icons/event_map.dds"

	minor_left_icon = c:RUS
	minor_right_icon = c:CHI

	duration = 3

	trigger = {

	}
	immediate = {

		if = {
			limit = {
				c:CHI = {
					owns_entire_state_region = STATE_OUTER_MANCHURIA
				}
			}
			random_state = {
				limit = {
					state_region = s:STATE_OUTER_MANCHURIA
				}
				save_scope_as = aigun_state
			}
		}
		else = {
			c:MCH = {
				random_state = {
					limit = {
						state_region = s:STATE_OUTER_MANCHURIA
					}
					save_scope_as = aigun_state
				}
			}
		}

		c:RUS = {
			save_scope_as = rus_scope
		}

		c:TPG = {
			save_scope_as = tpg_scope
		}
	}

	option = {
		name = heavenly.8.a
		default_option = yes
		ai_chance = { base = 75 }

		if = {
			limit = {
				c:CHI = {
					owns_entire_state_region = STATE_OUTER_MANCHURIA
				}
			}
			random_state = {
				limit = {
					state_region = s:STATE_OUTER_MANCHURIA
				}
				set_state_owner = c:RUS
				set_state_type = unincorporated
			}
		}
		else = {
			c:MCH = {
				random_state = {
					limit = {
						state_region = s:STATE_OUTER_MANCHURIA
					}
					set_state_owner = c:RUS
					set_state_type = unincorporated
				}
			}
		}

		c:RUS = {
			create_truce = {
				country = c:CHI
				months = 12
			}
		}

	}
	option = {
		name = heavenly.8.b
		ai_chance = { base = 25 }

		if = {
			limit = {
				c:CHI = {
					owns_entire_state_region = STATE_OUTER_MANCHURIA
				}
			}
			c:RUS = {
				create_diplomatic_play = {
					name = manchurian_conquest
					type = dp_conquer_state		
					target_state = s:STATE_OUTER_MANCHURIA.region_state:CHI
				}			
			}
		}
		else = {
			c:RUS = {
				create_diplomatic_play = {
					name = manchurian_conquest
					type = dp_conquer_state		
					target_state = s:STATE_OUTER_MANCHURIA.region_state:MCH
				}			
			}
		}

	}
}

